<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<link rel="stylesheet" type="text/css" href="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/themes/ui-lightness/jquery.ui.css"  />
<div class="wrap">
  <div class="tabmenu">
    <?php include template('layout/submenu');?>
    <?php if($output['member_info']['member_exppoints']>=999){  //普通会员不显示购买;?>
   <a class="ncbtn ncbtn-bittersweet" title="在线购买库存积" href="/member/index.php?act=predeposit&op=recharge_add&payvipkucun=kucunpointsbuy" style="right: 50px;"> <i class="icon-shield"></i>购买库存积分</a> 
    <?php } ?>
   </div>
  <div class="alert alert-block">
  <h4>库存积分购买与使用规则</h4>
<ul>
<li>◇ 库存积分为宝凯俪德商城联盟商家、企业<em style="color:#F00">线下收银时使用</em>，创业会员并成为联盟商家、企业后方可购买库存积分！</li>
<li>◇ 库存积分购买的比例为1元=625库存积分。</li>
<li>◇ 库存积分仅作为线下收银时使用，不可退及不参与转换。</li></ul>
</div>
<!---->
<!---->
  <style>
    .redpoints{width:100%; margin:5px 0 0 0; padding:0px;}
	.redpoints ul { list-style:none; margin:0px; padding:0px;}
	.redpoints ul li { list-style:none; margin:0px; padding:0px; float:left; font-size:16px;}
  </style>
  <form method="get" action="index.php">
    <table class="ncm-search-table">
      <input type="hidden" name="act" value="member_points" />
      <tr><td >可用库存积分：<strong style="color: #F00;"><?php echo round($output['member_info']['kucun_points'],2);?></strong></td>
        <th><?php echo $lang['points_addtime'] ?></th>
        <td class="w240"><input type="text" id="stime" name="stime" class="text w70" value="<?php echo $_GET['stime'];?>"><label class="add-on"><i class="icon-calendar"></i></label>&nbsp;&#8211;&nbsp;<input type="text" id="etime" name="etime" class="text w70" value="<?php echo $_GET['etime'];?>"><label class="add-on"><i class="icon-calendar"></i></label></td>
        <th><?php echo $lang['points_pointsdesc']; ?></th>
        <td class="w160"><input type="text" class="text w150" id="description" name="description" value="<?php echo $_GET['description'];?>"></td>
        <td class="w70 tc"><label class="submit-border">
            <input type="submit" class="submit" value="<?php echo $lang['nc_search'];?>" />
          </label></td>
        <td></td>        
      </tr>
    </table>
  </form>
  <table class="ncm-default-table">
    <thead>
      <tr>
        <th class="w150"><?php echo $lang['points_addtime']; ?></th>
        <th class="w180"><?php echo $lang['points_pointsnum']; ?></th>
        <th class="w180"><?php echo $lang['points_stage']; ?></th>
        <th class="tl"><?php echo $lang['points_pointsdesc']; ?></th>
      </tr>
    </thead>
    <tbody>
      <?php  if (count($output['list_log'])>0) { ?>
      <?php foreach($output['list_log'] as $val) { ?>
      <tr class="bd-line">
        <td class="goods-time"><?php echo date('Y-m-d H:i:s',$val['pl_addtime']);?></td>
        <td class="goods-price"><?php echo ($val['pl_points'] > 0 ? '+' : '').$val['pl_points']; ?></td>
        <td><?php 
	              	switch ($val['pl_stage']){
						//
						case 'kucunpointsbuy':
	              			echo '库存积分购买';
	              			break;
						case 'kucunpointssell':
	              			echo '库存积分使用';
	              			break;
						//
	              		case 'regist':
	              			echo $lang['points_stage_regist'];
	              			break;
	              		case 'login':
	              			echo $lang['points_stage_login'];
	              			break;
	              		case 'comments':
	              			echo $lang['points_stage_comments'];
	              			break;
	              		case 'order':
	              			echo $lang['points_stage_order'];
	              			break;
	              		case 'system':
	              			echo $lang['points_stage_system'];
	              			break;
	              		case 'pointorder':
	              			echo $lang['points_stage_pointorder'];
	              			break;
	              		case 'app':
	              			echo $lang['points_stage_app'];
	              			break;
	              	}
	              ?></td>
        <td class="tl"><?php echo $val['pl_desc'];?></td>
      </tr>
      <?php } ?>
      <?php } else { ?>
      <tr>
        <td colspan="20" class="norecord"><div class="warning-option"><i>&nbsp;</i><span><?php echo $lang['no_record']; ?></span></div></td>
      </tr>
      <?php } ?>
    </tbody>
    <tfoot>
      <?php  if (count($output['list_log'])>0) { ?>
      <tr>
        <td colspan="20"><div class="pagination"><?php echo $output['show_page']; ?></div></td>
      </tr>
      <?php } ?>
    </tfoot>
  </table>
</div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery-ui/i18n/zh-CN.js" charset="utf-8"></script> 
<script language="javascript">
$(function(){
	$('#stime').datepicker({dateFormat: 'yy-mm-dd'});
	$('#etime').datepicker({dateFormat: 'yy-mm-dd'});
});
</script>
<script language=javascript>
var cao_x,cao_y;
function cao888() 
{
this.display=display; 
}
function display() 
{
  //document.write("<table align=center><tr><td><button style='width:100px;height:30px;font-size:12px;border:1px solid #A4B3C8;background-color:green;' type=button onclick=document.getElementById('cao1').style.display='block' onfocus=this.blur()>点击弹出</button></td></tr></table>");
  document.write("<div  id='cao1' style='font-size:12px;position:absolute;display:none;text-align:center;overflow:visible'>");
  document.write("<div style='position:absolute;top:expression((body.clientHeight-300)/2);left:expression((body.clientWidth-200)/2);width:400px;height:300px;background-color:#dbdbdb;border:1px solid #cccccc;'>");
//  document.write("<table width=600 height=20 bgcolor=green onmousedown='cao_x=event.x-parentNode.style.pixelLeft;cao_y=event.y-parentNode.style.pixelTop;setCapture();' onmouseup='releaseCapture();' onmousemove='caoMove(this.parentNode)' style='cursor:move;'>");
//  document.write("<tr align=center>");
//  document.write("<td align=left>余额购买库存积分</td>");
//  document.write("</tr>");
  //document.write("</table>");
//  document.write("<div>");
  //document.write("<ul><li>购买金额:<input type='text' value=''></li></ul>");
//  document.write("</div>");
  document.write("<br><br><span style= font-size:14px cursor:hand onclick=this.parentNode.parentNode.style.display='none';>关闭</span>");
  document.write("<iframe marginwidth='0' marginheight='0' frameborder='0' scrolling='no' src='/pay_kucun.php?username=<?php echo $output['member_info']['member_name'];?>' width=100% height=300></iframe>");
  document.write("  </div>");
  document.write("</div>");
}
function caoMove(obj)  //实现层的拖移
{
  if(event.button==1)
  {
    var caoX=obj.clientLeft;
    var caoY=obj.clientTop;
    obj.style.pixelLeft=caoX+(event.x-cao_x);
    obj.style.pixelTop=caoY+(event.y-cao_y);
  }
}
</script>
<script language=javascript>
var mycao=new cao888();
mycao.display();
</script>